<!--
 * @Author: ReinerLau lk850593913@gmail.com
 * @Date: 2022-09-22 12:56:14
 * @LastEditors: ReinerLau lk850593913@gmail.com
 * @LastEditTime: 2022-09-22 13:28:59
 * @FilePath: \robot\src\views\patroling\ActionBox.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="absolute top-0 left-20 flex">
    <div
      class="w-0 h-0 border-[20px] border-[transparent] border-r-[#072232] border-solid"
    />
    <div class="w-60 overflow-hidden bg-[#072232] p-3">
      <div
        v-for="action in actionList"
        :key="action.title"
        class="text-white mb-3 text-center py-3 rounded"
        :style="{ backgroundColor: action.color }"
        @click.stop="handleClick(action.value)"
      >
        {{ action.title }}
      </div>
    </div>
  </div>
</template>
<script setup>
defineProps({
  actionList: {
    type: Array,
    default: () => [],
  },
});

const emit = defineEmits(["action"]);

function handleClick(value) {
  emit("action", value);
}
</script>
